package com.fj.netty.chat.server.service.impl;

import com.fj.netty.chat.server.service.UserService;
import io.netty.channel.Channel;

import java.util.HashMap;
import java.util.Map;

/**
 * @author fj
 * @date 2024/1/12 09:40
 */
public class UserServiceImpl implements UserService {
    private final Map<String,String> userMap = new HashMap<>();
    {
        userMap.put("zhangsan","123");
        userMap.put("lisi","123");
        userMap.put("wangwu","123");
        userMap.put("zhaoliu","123");
    }
    @Override
    public boolean login(String username, String password) {
        String pwd = userMap.get(username);
        return pwd != null && pwd.equals(password);
    }

    @Override
    public boolean bind(Channel channel, String username) {
        return false;
    }
}
